package com.woniu.day8.mapper;

import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import com.woniu.day8.pojo.Role;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Select;

import java.util.List;

@Mapper
public interface RoleMapper extends BaseMapper<Role> {

    /**
     * 根据用户id查询对应角色集合
     */
    @Select("select * from t_role r join t_user_role ur on r.rid=ur.rid where ur.uid = #{uid}")
    List<Role> queryRoleByUid(Integer uid);
}